const Koa = require('koa')
const app = new Koa()


const helloMiddleware = async (ctx, next) => {
	await next();
	ctx.response.type = "text/html"
	ctx.response.body = '<h1>Hello Koa!</h1>'
}

// async function helloMiddleware(ctx, next) {
// 	await next();
// 	ctx.response.type = "text/html"
// 	ctx.response.body = '<h1>Hello Koa!</h1>';
// }
// 

app.use(helloMiddleware)

//监听3000端口
app.listen(80, () => {
	console.log('server is running at http://localhost:80')
});
